Release 10.1A: OpenEdge Development:
Progress Dynamics Advanced Development
Field and widget lists
Application code often must identify and get the handles of the fields and other objects inside another object. This section describes some properties that give you that information.
DisplayedFields and FieldHandles
These
CHARACTERproperties are defined forDatavisobjects, that is, SmartObjects that visualize data from a query (normally from an SDO). For a viewer, theDisplayedFieldsproperty returns a comma-separated list of all the fields in the viewer that come from the SDO, and theFieldHandlesproperty returns theWIDGET-HANDLEof those fields. The fields can be any type that can display data, includingFILL-IN,EDITOR,RADIO-SET, and so on.The
FieldHandlesproperty returns a comma-separated list as well, with each handle converted to a text string. To retrieve the native handle from the list, you must apply theWIDGET-HANDLE4GL function to the appropriate entry in the list. Both lists are always in the same order so that the standard way to get the handle of a field is to look it up in theDisplayedFieldslist and then locate the corresponding entry in theFieldHandleslist. For example:
This bit of code yields the display shown in Figure 5–1 at run time for the first
Customerrecord.Figure 5–1: Customer record message box
![]()
In the case of a SmartDataField in a viewer, which is a SmartObject procedure in its own right representing a single field value, the entry in
FieldHandlesis its procedure handle. The corresponding entry in theDisplayedFieldslist always points to the field name in theDataSource.For example, code that manipulates the handle must always check the
TYPEattribute, as shown:
The SmartDataField supports various internal functions that provide parallels to the properties of ordinary field-level widgets. For more information, see OpenEdge Development: ADM Reference .
For a browser, the
DisplayedFieldsandFieldHandlesproperties return the list of columns in the browse itself and the handles to the browse cells for those columns.EnabledFields and EnabledHandles
These two
CHARACTERproperties correspond to theDisplayedFieldsandFieldHandlesproperties, except that they return only fields or browse cells that are enabled for input.AllFieldNames and AllFieldHandles
These
CHARACTERproperties, available for all visual objects (datavis class), return a list of all widgets in the SmartObject’s frame. This list includes the data fields that theDisplayedFieldsproperty returns as well as all other objects in the frame that are not derived from an SDO. For example, there might be non-SDO fields, along with field labels, rectangles, and buttons. Each of these is a separate widget with its own handle. For the SmartDataField, the procedure handle appears in the handle list.These properties can be useful if you must manipulate objects in a viewer that are outside the standard field list, such as buttons. You can also use it for visual containers that have no SDO fields, such as a SmartWindow.
Currently, note that for browsers, these properties return the names and handles of the objects in the frame, not the columns in the browser. Thus, just a single name (
brtable) comes back for the browse widget itself in theNameslist, and its widget handle in theHandleslist, along with the names and handles of any other objects that might be in the SmartBrowser’s frame along with the browse control. If you need the column list, you must use theDisplayedFieldsandFieldHandlesproperties.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |